<!DOCTYPE html>
<html lang='zh-CN'>
  <head>
    <title>电子邮件</title>
    <meta charset='utf-8' />
    <meta http-equiv='content-type' content='text/html;charset=utf-8' />
  </head>
  <body>
    <form id='frm' role='form' onsubmit='return push()'>
      <input type="text" name="signature" placeholder="签名"><br/>
      <input type="text" name="to" placeholder="收件人" value="3203317@qq.com;7357877@qq.com"><br/>
      <input type="text" name="subject" placeholder="标题" value="新用户注册"><br/>
      <input type="text" name="content" placeholder="内容" id='content'><p/>
      <button type='submit'>提交</button>
    </form>
  </body>
</html>

<script type='text/javascript' src='https://www.foreworld.net/js/jquery/2.0.2/jquery.min.js'></script>
<script type='text/javascript' src='https://www.foreworld.net/js/underscore/1.5.1/underscore.min.js'></script>
<script type='text/javascript' src='https://www.foreworld.net/js/jquery/ext/ext.form.js'></script>
<script>
  $(function(){
    $('#content').val('您的验证码：'+ _.random(100000, 999999));
  });

  function push(){
    var _data = $('#frm').serializeObjectForm();
    _data.appkey = 'db5a71f88e99484b80c31b1611b69109';

    $.ajax({
      url: 'http://127.0.0.1:3003/api/email/sendByTLS',
      type: 'GET',
      dataType: 'JSON',
      data: _data,
      success: function(data){
        console.log(data);
      },
      error: function(){
        console.log(arguments);
      }
    });

    return false;
  }
</script>
